<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form" >


        <el-descriptions  title="归属管理" style="text-align: center" :column="4" border >
          <el-descriptions-item :contentStyle="contentStyle" label="地图名称" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.dataname}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="责任人员" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.firstpeople }}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="存放位置" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.position }}</el-descriptions-item>


             </el-descriptions>
        <br/>
        <el-descriptions  title="详细内容" style="text-align: center" :column="4" border >
          <el-descriptions-item :contentStyle="contentStyle" label="地图分类" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.category }}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="二级分类" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.secondclassify }}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="地图条码" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.barcode }}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="电子附件" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >
            <el-button @click="hadledownload">下载</el-button>
          </el-descriptions-item>
        </el-descriptions>
        <br/>
        <el-descriptions  title="日期备注" style="text-align: center" :column="4" border >
          <el-descriptions-item :contentStyle="contentStyle" label="创建日期" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.daydate }}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="备注信息" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.remark }}</el-descriptions-item>
        </el-descriptions>

      </el-form>
      <br/>
      <div style="float:right; margin-bottom: 15px;">
        <el-button @click="viewCancel">返 回</el-button>
      </div>
    </el-card>
  </div>
</template>
<script>
  import { listMap, getMap, delMap, addMap, updateMap } from "@/api/group/whd/map";

  export default {

    name: "Issues",
    data() {
      return {
        contentStyle:{
          'width':'200px'
        },
        form:{},
        labelStyle: { 'width': '12%','color': '#000000','text-align': 'right', },
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: false,
        // 总条数
        total: 0,
        // 部门树选项
        deptOptions: undefined,
        // 合同资料表格数据
        fileList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
      };
    },

    created() {
      const id = this.$route.query.id;
      if (id) {
        // 获取表详细信息

        getMap(id).then(res => {

          this.form = res.data;
        });

      }
    },
    methods: {


      /** 关闭按钮 */
      viewCancel() {
        const id = this.$route.query.id;
        getMap(id).then(response => {
          this.form = response.data;
        });
        const obj = { path: "/basedata/mapdata", query: {id} };
        this.$tab.closeOpenPage(obj);
      },


      hadledownload(){

        const resource = this.form.enclosure;
console.log( this.form.enclosure+"path");
// 默认方法
        this.$download.resource(resource);
      }
    },

  };
</script>






